﻿define(function (require) {
    return Backbone.View.extend({

        tagName: "li",
        template: _.template($('#tpl-app').html()),

        events: {
        },

        initialize: function () {
            $(this.el).addClass('apps-container');

            _.bindAll(this, 'render');
            this.model.bind('change', this.render);
            this.model.view = this;
        },

        render: function () {
            $(this.el).html(this.template(this.model.toJSON()));
            if (this.model.get('url')) {
                $(this.el).find('a.ezlink').attr('href', this.model.get('url'));
            }            
            return this;
        }

    });
});